@extends('layouts.header')
@section('content')
    <h2>Add moderator for {{$subtopic}}</h2>

    <!-- Show any validation errors, in case they exist -->
    @if ($errors->any())
    <div class="alert alert-danger">
        <ul>
            @foreach ($errors->all() as $error)
                <li style="color: red;">{{ $error }}</li>
            @endforeach
        </ul>
    </div>
    @endif
    <!-- Add new moderator forms -->
    <form action="{{ route('store_new_moderator', ['sub'=>$subtopic])}}" method="POST">
        {{ csrf_field() }}

        <div class="form-group">
            <label for="moderator_id">New moderator: </label>
            <select name="moderator_id" style="width: 1237px;" class="form_control">
            @foreach($not_mods as $user)               
                <option value="{{ $user->id }}"> {{ $user->name }}</option>                
            @endforeach
            </select><br /><br />
        </div>

        <div class="form-group">
            <input type="hidden" name="subtopic" value="{{$subtopic}}">
            <button type="submit" class='btn btn-primary'>Add</button>
        </div>
    </form>
@endsection()